package com.baizhi.controller;

import com.baizhi.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by 野马 on 2019/6/19.
 */
@Controller
@RequestMapping("/log")
public class LogController {
    @Autowired
    private LogService logService;

    @RequestMapping("/select")
    @ResponseBody
    public Map select(String username,int page,int rows){
        return logService.selectLog(username, page, rows);
    }

    @RequestMapping("/deletepl")
    @ResponseBody
    public Map deletepl(@RequestParam("ids")int[] logIds){
        Map map = new HashMap();
        try {
            logService.deletepl(logIds);
            map.put("deletepl",true);
        } catch (Exception e) {
            map.put("deletepl",false);
            e.printStackTrace();
        }
        return map;
    }








}
